package com.luo.simple.springConfig;

import com.github.pagehelper.PageHelper;
import com.luo.simple.entity.IdWorker;
import org.springframework.context.annotation.Bean;

import java.util.Properties;

public class IdWorkerConfig {
    @Bean
    public IdWorker idWorker() {
        return new IdWorker(1, 11, 1);
    }

    @Bean
    public PageHelper pageHelper() {
        PageHelper pageHelper = new PageHelper();
        Properties p = new Properties();
        p.setProperty("dialect", "mysql");
        p.setProperty("offsetAsPageNum", "true");
        p.setProperty("rowBoundsWithCount", "true");
        pageHelper.setProperties(p);
        return pageHelper;
    }
}
